import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  mode: 'hash',
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: '登录',
      component: () => import('@/views/login/index.vue')
    },
    {
      path: '/home',
      name: '首页',
      redirect: '/message',
      component: () => import('@/views/home/index.vue'),
      children: [
        {
          path: '/message',
          name: '聊天',
          component: () => import('@/views/message/index.vue')
        },
        {
          path: '/contact',
          name: '联系人',
          component: () => import('@/views/contact/index.vue')
        }
      ]
    }
  ]
})

export default router
